# coding:utf-8

# def say(name, age):
#     return "我是" + name + "，我今年" + str(age) + "岁"
#
#
# result = say("小明", 21)
# print(result)


# # 不可变类型进行重新赋值，原来的变量直接舍弃
# a = 100
# print(id(a))    #8791105702048
# a = 200
# print(id(a))    #8791105705248
#
#
# #可变类型，修改之后，存储位置并没有改变
# list=['北京','上海','广州']
# print(id(list))             #6312456
#
# list.append("深圳")
# print(id(list))             #打印：6312456


# # 参数传递不可变类型
# def fun(a):
#     a=200;
#     return a
#
# a=100
# print("调用函数之前"+str(a))       #100
# fun(a)
# print("调用函数之后"+str(a))      #100


# 参数是可变类型
def fun(list):
    list.append("长沙")
    return list


list = ['北京', '上海']
print("调用函数之前" + str(list))     #调用函数之前['北京', '上海']
fun(list)
print("调用函数之后" + str(list))     #调用函数之后['北京', '上海', '长沙']
